{% extends "base.html" %}

{% block title5 %}
    active
{% endblock %}

{% block page-body %}
    <h1 class="page-header">信息查询</h1>

    <!--面板 开始-->
    <div class="panel panel-primary">
    <div class="panel-heading">软件加固</div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-12 main">
                <form action="/search_myworksoftware/" method="post">
                    {% csrf_token %}
                    <div class="col-md-4" style="padding-bottom: 4px;padding-left:0px">
                        <div class="input-group">
                            <input name="ip" id="serach_ip" type="text" class="form-control" placeholder="请输入IP">
                            <span class="input-group-btn"><button style="padding:6px 12px 7px;"
                                                                  class="btn btn-default"
                                                                  type="submit">搜索</button></span>
                        </div>
                    </div>

                </form>

                <table class="table table-bordered table-hover table-condensed text-justify">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>IP</th>
                        <th>加固日期</th>
                        <th>系统版本</th>
                        <th>软件版本</th>
                        {% if request.session.username %}
                            <th>操作</th>
                        {% endif %}
                    </tr>
                    </thead>
                    <tbody>
                    {% for i in software %}
                        <tr>
                            {#                                        <td>{{ forloop.counter }}</td>#}
                            <td>{{ forloop.counter }}</td>
                            <td>{{ i.mywork_software.ip }}</td>
                            <td>{{ i.mywork_software.date.isoformat }}</td>
                            <td>{{ i.mywork_software.os.os }}</td>
                            <td>{{ i.software.software }}</td>
                            {% if request.session.username %}
                                <td>
                                    <a href="/edit_myworksoftware/?id={{ i.id }}" class="btn btn-warning btn-sm"
                                       type="button">修改</a>
                                <a name="id" class="btn btn-danger btn-sm" href="/delmyworksoftware/?id={{ i.id }}">删除</a>
                                </td>
                            {% endif %}
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
                <nav class="pull-right" aria-label="Page navigation">
                    <ul class="pagination">
                        {{ page_info.pager|safe }}
                    </ul>
                </nav>
            </div>
        </div>
        <!--面板body 结束-->
    </div>
{% endblock %}

{% block page-script %}


{% endblock %}